package henry;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

public class Eudic {

    public static void main(String[] args) {

        List<Integer> test_list = new ArrayList<>();
        for (int i = 0; i < 10; i++) {
            test_list.add(i);
        }
        System.out.println(test_list);
//        test_list.forEach(System.out::println);
        System.out.println("================");
        Iterator<Integer> iterator = test_list.iterator();
        while (iterator.hasNext()){
            Integer value = iterator.next();
            System.out.println(value);
            if(value > 7){
                iterator.remove();
            }
        }
        System.out.println("================");
        System.out.println(test_list);
    }
}
